package com.project.weimi.widget;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.util.AttributeSet;
import android.widget.EditText;

/**
 * 带下划线的EditText
 * @author Administrator
 *
 */
public class UnderLineEditText extends EditText {

	private Paint mPaint; 
	
	public UnderLineEditText(Context context, AttributeSet attrs) {
		super(context, attrs);
		mPaint = new Paint();  
		mPaint.setStyle(Paint.Style.STROKE);  
		mPaint.setColor(Color.GRAY);  
	}

	public UnderLineEditText(Context context) {
		super(context);
	}

	@Override
	protected void onDraw(Canvas canvas) {
		super.onDraw(canvas);
		// 画底线  
        canvas.drawLine(0,this.getHeight()-1,  this.getWidth()-1, this.getHeight()-1, mPaint);  
	}
	
	
}
